package machine.api;

import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import machine.bean.Tencent;
import org.springframework.stereotype.Service;

/**
 * 通过qq号获取昵称
 *
 * @author zhanghui145
 * @date 2021/12/26 15:55
 * @since 1.0.0
 */
@Service
public class TencentApi {

    private static final String URI = "https://api.btstu.cn/qqxt/api.php?qq=";

    public Tencent getByQQ(String qq){
        String rs = HttpRequest.get(URI + qq).execute().body();
        return JSONUtil.parseObj(rs).toBean(Tencent.class);
    }
}
